package com.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.entity.dto.MoctaDto;
import com.example.entity.dto.inspect.NoDeviceMoctyListDto;
import com.example.entity.dto.pc.SelWorkResourceDto;
import com.example.entity.vo.PgListVo;
import com.example.entity.vo.pc.MoctyBindingResourceVo;
import com.example.entity.vo.pc.MoctyPlus;
import com.example.entity.vo.pc.SelMoctyScheduleTypeVo;
import com.example.entity.vo.pg.PaiGongItemVo;
import com.example.entity.yifei.Mocty;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author LiangPandeng
 * @since 2024-02-28
 */
public interface MoctyMapper extends BaseMapper<Mocty> {

    @Select("select TY004 from MOCTY where TY001 = #{TY001} and TY002 = #{TY002} and TY019 = #{TY019}")
    public BigDecimal getTY004WithTE001WithTE002WithTE019(String TY001, String TY002, String TY019);

    void updateTy006ByTy001WithTy002WithTy019WithTy003WithTy009(String workOrder, Double te001);

    Double getTy004SumByTY001TY002(@Param("TY001")String TY001 , @Param("TY002")String TY002, @Param("TY019")String TY019);

    List<String> getDates(@Param("db")String db, @Param("dh")String dh, @Param("gx")String gx);

    List<PaiGongItemVo> getPGListFromMocty(MoctaDto moctaDto);

    List<PgListVo> getList(MoctaDto moctaDto);

    List<PaiGongItemVo> getPGListFromMocta(MoctaDto moctaDto);

    List<MoctyPlus> moctyListOn(String status);

    MoctyPlus getMoctyPlus(String udf05);

    List<MoctyPlus> moctyListByResourceId(String date, String resourceGroupId, List<String> statusList);

    List<MoctyPlus> noDeviceMoctyList(NoDeviceMoctyListDto dto);

    List<MoctyBindingResourceVo> moctyList(NoDeviceMoctyListDto dto);

    List<MoctyPlus> getMoctyPlusList(SelWorkResourceDto dto);

    List<MoctyPlus> getMoctyPlusListYuan(SelWorkResourceDto dto);

    List<MoctyPlus> getMoctyPlusListByTy003(SelWorkResourceDto dto);

    List<MoctyPlus> moctyOnQueueListByMocStatus(List<String> statusList);

    List<MoctyPlus> moctyOnQueueListByMocStatusAndDate
            (@Param("statusList") List<String> statusList, @Param("leftTime") String leftTime, @Param("rightTime") String rightTime);

    List<MoctyPlus> moctyOnQueueListByMocStatusAndDateAndMacId
            (@Param("statusList") List<String> statusList, @Param("leftTime") String leftTime, @Param("rightTime") String rightTime,@Param("resourceGroupIdIsF") String resourceGroupIdIsF);

    List<MoctyPlus> selListNoST4();

    List<MoctyPlus> moctyListByResourceIdMocta(@Param("date") String date, @Param("resourceGroupId") String resourceGroupId,@Param("statusList")  List<String> statusList);

    List<MoctyPlus> moctyOnQueueListByMocStatusMocta(List<String> statusList);

    BigDecimal getKeBaoShu(@Param("ty001") String ty001, @Param("ty002") String ty002);

    Mocty oneMocty(@Param("TY001") String ta001, @Param("TY002") String ta025TA006);

    List<SelMoctyScheduleTypeVo> selMoctyScheduleType(@Param("dates") String date, @Param("list") List<MoctyPlus> moctamoctyList);

    List<Mocty> selMoctyTongShuai(@Param("db") String db, @Param("dh") String dh, @Param("date") String date);
}
